﻿#ifndef _OI_PLSCANNER_MOTORCONTROLWIDGET_HPP_
#define _OI_PLSCANNER_MOTORCONTROLWIDGET_HPP_

namespace Oi
{
    namespace PLScannerCore
    {
        class OI_PLSCANNER_CORE_API MotorControlWidget : public QWidget
        {
            Q_OBJECT

        public:
            enum AxisStatus
            {
                Axis_Error = 0x01000000,
                Axis_InspectPos = 0x02000000,
                Axis_WaitPos = 0x04000000,
                Start_Inspect = 0x8000000,
            };

            enum AxisCommand
            {
                Auto_Mode = 0x01000000,
                Forward_Jog = 0x02000000,
                Backward_Jog = 0x04000000,
                Axis_Home = 0x08000000,
                Axis_Reset = 0x10000000,
                Axis_Calib = 0x20000000,
                Axis_InspectOver = 0x40000000,
                Axis_RedLight = 0x00040000,
                Axis_GreenLight = 0x00010000,
                Axis_StartMove = 0x00020000,
            };

        public:
            MotorControlWidget(QWidget * parent = nullptr);
            ~MotorControlWidget();

        private slots:
            //void onManualButtonClicked();
            void onTimerTimeout();

        protected:
            void hideEvent(QHideEvent *event);
            void showEvent(QShowEvent *event);
            bool eventFilter(QObject *obj, QEvent *event);

        private:
            OI_DECLARE_IMPL(MotorControlWidget);
            OI_DISABLE_COPY(MotorControlWidget);
        };
    }
}


#endif
